<?php
namespace Home\Controller;
use Home\Model\ClassService;
use Home\Model\ClassStudentService;
use Think\Controller;

class StuClassController extends HomeController{
    //---------------------------------跳转到学生所有所在班级的页面-------------------------------------
    public function classes(){
        $cla_sql = new ClassService();
        $cla_sql->filedClass();                 //先做归档处理
        $this->display();
    }
    //---------------------------------获得学生所有未归档班级-------------------------------------
    public function getClasses(){       //不需要任何数据!!方法会从Session中取!!
        if(IS_AJAX) {
            $cs_sql = new ClassStudentService();
            $cla_field = array("cla_id","cla_name","cla_stu_num","cla_code","cla_start","cla_end","cou_name");
            $data = $cs_sql->getStuAllClass(0,$cla_field);         //获得未归档的班级
            $this->ajaxReturn($data);
        }
    }
    //---------------------------------获得学生所有归档班级-------------------------------------
    public function getFiledClasses(){  //不需要任何数据!!方法会从Session中取!!
        if(IS_AJAX) {
            $cs_sql = new ClassStudentService();
            $cla_field = array("cla_id","cla_name","cla_stu_num","cla_code","cla_start","cla_end","cou_name");
            $data = $cs_sql->getStuAllClass(1,$cla_field);         //获得归档的班级
            $this->ajaxReturn($data);
        }
    }
}